package com.cakin.javademo;

/**
 * @ClassName: com.cakin.javademo.Employee
 * @Description: 雇员实体类
 * @Date: 2020/6/11
 * @Author: cakin
 */

public class Employee{
    // 名字
    String name;
    // 年龄
    int age;
    // 职称
    String designation;
    // 薪水
    double salary;

    public Employee(String name, int age, String designation, double salary) {
        this.name = name;
        this.age = age;
        this.designation = designation;
        this.salary = salary;
    }

    public Employee() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getDesignation() {
        return designation;
    }

    public void setDesignation(String designation) {
        this.designation = designation;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    /* 打印信息 */
    public void printEmployee(){
        System.out.println("Name:"+ this.name );
        System.out.println("Age:" + this.age );
        System.out.println("Designation:" + this.designation );
        System.out.println("Salary:" + this.salary);
    }

    @Override
    public String toString() {
        return "com.cakin.javademo.Employee{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", designation='" + designation + '\'' +
                ", salary=" + salary +
                '}';
    }
}
